package dyyx.stream;

import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class SimpleStream {

	public static void main(String[] args) throws Exception {
		
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
		 
	    System.out.println(env);	
	    System.out.println("parallelism="+env.getParallelism());	

	    env.setParallelism(1);
	    
	    System.out.println("parallelism2="+env.getParallelism());	

        DataStream<String> text = env.fromElements(
            "hello","cat","dog","cat","hello","cat","dog","dog","cat"
        );
                
        
        text.print();
        
     
        env.execute();

	}
	
	

}
